<template>
  <div class="mainHeader">
    <div class="menuIcon">
      <el-icon size="25" @click="handeleFoldChange">
        <component :is="isFold ? 'Fold' : 'Expand'"></component>
      </el-icon>
    </div>
    <div class="content">
      <div class="bread"><breadCrumb></breadCrumb></div>
      <headerInfo></headerInfo>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, defineEmits } from 'vue'

import headerInfo from './child/headerInfo.vue'
import breadCrumb from './child/breadCrumb.vue'

const emits = defineEmits(['foldChange'])
const isFold = ref(false)

function handeleFoldChange() {
  isFold.value = !isFold.value

  emits('foldChange', isFold.value)
}
</script>

<style lang="scss" scoped>
.mainHeader {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  .menuIcon {
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  .content {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    padding: 0px 18px;
  }
}
</style>
